Some computing devices include web browser application programs that enable users of the devices to request and view web pages. A user may request that the web browser display a web page, for example, by typing the Uniform Resource Locator (URL) for that web page into an address bar of the web browser. The web browser may request, over the internet, resources that correspond to the URL. A server system may receive the request and return a set of resources to the computing device. The set of resources can include a HyperText Markup Language (HTML) document and a JavaScript document.
The web browser may process the resources and display a web page based on the content of the resources. Some of the links in the web page, when selected by the user, may prompt the web browser to request resources for different web pages. Other of the links in the web page, however, may cause the web browser to present a different “screen” of the web page to the user. This different screen may be generated based on instructions in the same set of resources and without requesting further resources over the internet.
The screens of a web page may be designated by different hash fragments in the URL address for the web page. For example, the address bar of the web browser may display the URL www.examplesite.com/#first_screen for a first screen of a web page that is displayed to a user, and may display the URL www.examplesite.com/#second_screen for a second screen of the web page. The hash fragment portion of the URL may be used solely for client-side processing and navigation, and may not be transmitted in requests, over the internet, for web page resources.
Some web browsers allow users to bookmark web pages, for example, by selecting a “Bookmark” interface element. Upon selecting the bookmark interface element, the web browser may determine if the displayed web page includes markup code that references a bookmark icon. A bookmark icon is an image that is displayed as at least a portion of a visual representation of the bookmark (e.g., an icon that is displayed on the desktop of a mobile device). A bookmark may designate a target network address. A target network address may be a URL that was located in a network address field of a web browser at a time that the bookmark was created.
The bookmark may designate a target network address that includes a hash fragment that designates a particular screen of a web page. Thus, when a user selects the bookmark, the web browser may request resources that are designated by a base portion of the URL, where the base portion of the URL is a portion of the URL that precedes the hash symbol in the URL. The computing device may receive resources that correspond to the base portion of the URL, and may generate an internal representation of the web page based on the received resources.
Before the web browser generates a display of the web page, and after it forms a basic representation of the web page, the web browser may execute scripting code that is included in the received resources. The scripting code may extract the hash fragment from the network address field, and may restructure the representation of the webpage so that the web page that will be displayed shows the web page screen that corresponds to the hash fragment. The web browser may restructure the representation of the web page without requesting additional resources over the network.
Thus, a user may create multiple bookmarks for the same set of resources, for example, bookmarks for different screens that can be generated using the same set of resources. The resources may reference a single bookmark icon. Thus, bookmarks for different screens of the web page may use the same bookmark icon.